//package com.wang.springbootinit.config;
//
//import com.wang.springbootinit.aop.LoginInterceptor;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
//import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//
//import javax.annotation.Resource;
//
//@Configuration
//public class IntercepterConfig implements WebMvcConfigurer {
//
//    @Resource
//    private LoginInterceptor loginInterceptor;
//
//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//        //addPathPatterns用于添加拦截路径
//        //excludePathPatterns用于添加不拦截的路径
//        registry.addInterceptor(loginInterceptor)
//                .excludePathPatterns("/user/login")
//                .excludePathPatterns("/file");
//    }
//    //此方法用于配置静态资源路径
//    @Override
//    public void addResourceHandlers(ResourceHandlerRegistry registry) {
////        registry.addResourceHandler("/**").addResourceLocations("classpath:/my/");
//    }
//}
